Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude app usage events table from using window function #3191

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

sethboyles
Copy link
Member

Similar to the issue reported in #3117, we have noticed performance degradation when using the OVER window function with app_usage_events when the tables has a large-ish number of row (around 150,000). This PR disables use of the window function for app_usage_events, just as we have disabled it for events.

@kathap @philippthun , since you both worked on the previous PR--are you concerned that this might be a trend with several of our tables? We don't have a lot of context on the performance benefits of the use of the OVER window function, and it feels like its use may be high risk. We were wondering if it might be worth disabling the OVER window for more models, or even all of them. Perhaps a configuration value in capi-release?

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun
Copy link
Member

I had a look at some database/query statistics/performance dashboards for our largest foundation and can confirm that queries on the app_usage_events table using the OVER window function are relatively slow. It does not seem to be as bad as for the events table, but excluding this table makes sense.

I agree that we should revisit the use of the OVER window function. It might be the case that - due to other recent improvements - its benefit is now neglectable. But in order to judge this, we would need to perform some performance tests with reasonable table sizes.

I'm also open to provide a means to disable the OVER window function by configuration (this might be even helpful to do the performance tests).

@moleske moleske merged commit 99c7d8c into main Feb 15, 2023
@moleske moleske deleted the app_usage_events_no_window_function branch February 15, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants